//
//  EFengPhotosFrame.m
//  WZEfengAndEtong
//
//  Created by wanzhao on 16/2/29.
//  Copyright © 2016年 wanzhao. All rights reserved.
//

#import "EFengPhotosFrame.h"

@implementation EFengPhotosFrame

- (void)setPhotos:(NSArray *)Photos
{
    _Photos = Photos;
    
    if (Photos.count > 0) {
        
        NSInteger count = 0;
        if (Photos.count <= 2 || Photos.count == 4) {
            if (self.videos.count>0) {
                self.height = self.width * 0.8;
            }
            else
            {
            count = Photos.count % 2 ? 1:0;
            self.height = (Photos.count / 2 + count) * ((self.width - 10.0f) / 2.0f + 5.0f) - 5.0f;
            }
        } else {
            count = Photos.count % 3 ? 1:0;
            self.height = (Photos.count / 3 + count) * ((self.width - 10.0f) / 3.0f + 5.0f) - 5.0f;
        }
       
    } else {
        self.height = 0.0f;
    }
    
}

@end
